# -*- coding: utf-8 -*-
# @Author  : haomh
# @Time    : 2025/11/6 11:44
# @Time    : 2025-11-01 14:08
# @Function:
from hashlib import algorithms_available
from pydoc import apropos


# def tesA():
#     a = 100
#     print(a)
#
# tesA()
# print(a) # 报错，局部变量只在函数体内部生效，name 'a' is not defined

# # 定义一个全部变量
# a = 100
#
#
# def tesA():
#     print(a)
#
#
# def tesB():
#     # global 关键字声明a就是全局变量
#     global a
#     a = 200
#     print(a)
#
#
# tesA()
# tesB()
# print(f'全局变量a={a}')

# 定义一个全部变量
# glo_num = 0
#
#
# def tes1():
#  定义一个全局变量
# glo_num =0
# def test1():
#     global glo_num
#     glo_num = 100
#
# def test2():
#     print(glo_num)
#
#
# # 调用test1函数，执行函数内部代码：声明和修改全局变量
# test1()
#
# test2()

# 返回值作为参数传递
# def test1():
#     return 50
#
# def test2(num):
#     print(num)
#
# result = test1()
# print(result)
# test2(result)




# def return_num():
#     # return 1,2  # 返回的是个元组
#     # return (10,20)
#     # return [10,20]
# result = return_num()
# print(result)



# 位置参数
# def user_info(name, age, gender):
#
#

# 缺省参数
#

#     print(args)
#
#
# user_info(*list1)

#     print(kwargs)
#
#

# print(a)
# print(b)

# 引用
# 1.int类型
# a = 1
# b = a
# print(b)
# print(id(a))
# print(id(b))
#
# a = 2

# aa = [10, 20]
# bb = aa
# print(id(aa))
# print(id(bb))
#
# aa.append(30)
#
# print(id(aa))
# print(id(bb))

# 引用当做实参
    print(a)
    print(id(a))
    a += a
    print(a)
    print(id(a))


b = 100

